<?
define('PROFILE', !class_exists('profile'));
$data->profile->my = profile::get(array('ID'=>UID));
//echo '<pre>'.print_r($data->profile->my,1).'</pre>';
if(!UNCONFIRMED && MEMBER && !($data->profile->my->gender
    && $data->profile->my->age
    && $data->profile->my->hometown->region->name
    && $data->profile->my->hometown->country->name
    && $data->profile->my->relationshipStatus
    && ($data->profile->my->interestedIn->men || $data->profile->my->interestedIn->women)
    && ($data->profile->my->lookingFor->friendship
        || $data->profile->my->lookingFor->dating
        || $data->profile->my->lookingFor->relationship
        || $data->profile->my->lookingFor->networking))){
    common::guide(GUIDE_ALERT,
            dgettext('profile',sprintf('Opps! You have not completed your basic information on your profile yet! %sClick here%s to complete your profile!',
                    '<a href="/'.LANG.'/profile/edit">','</a>')));
}
define('HASUSERNAME',$data->profile->my->username);
if(!HASUSERNAME){
    //$data->profile->hasphoto = profile::photo(null,'check');
    //define('HASPHOTO',$data->profile->hasphoto);
    if(!UNCONFIRMED && ACCESS && !HASUSERNAME && (APP != 'profile' || CMD != 'edit')) {
        header('location: /'.LANG.'/profile/edit');
    } elseif(!UNCONFIRMED && ACCESS && !HASUSERNAME){
        common::guide(GUIDE_ERROR, dgettext('profile','You must select an username to use the system!'));
    }
} elseif(PROFILE_PHOTOS_MUST){
    $data->profile->hasphoto = profile::photo(null,'check');
    define('HASPHOTO',$data->profile->hasphoto);
    if(!UNCONFIRMED && ACCESS && !$data->profile->hasphoto && (APP != 'profile' || CMD != 'upload')) {
        header('location: /'.LANG.'/profile/upload');
    } elseif(!UNCONFIRMED && ACCESS && !$data->profile->hasphoto){
        common::guide(GUIDE_ERROR, dgettext('profile','You must upload at least one profile photo to use the system!'));
    }
}
?>